import { defineComponent, onMounted, reactive, ref } from 'vue';

export default defineComponent({
  // props: {

  // },
  setup(props) {
    const data = reactive({ count: 0 });
    const arr = ref([0,1,2,3])
    onMounted(() => {
      data.count = 5;
    });
    const fun = (item:number) => {
      alert(item)
    };
    const func = () => {
      console.log(123);
    }
    return () => (
      <>
        <h2 onClick={func}>{data.count}</h2>
        <div>
          <p>{data.count === 5 ? 0:1}</p>
          {
            arr.value.map((item, index) => {
              return (
                <p onClick={() => fun(item)}>{item} - {index}</p>
              )
            })
          }
        </div>
      </>
    );
  },
});
